package com.hillstone.oauth2server.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.token.TokenService;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.web.bind.annotation.DeleteMapping;

/**
 * @author 刘
 * @anthor: lddd
 * @date: 2022/4/17 - 16:12
 * @description:
 **/
public class LogoutController {
    @Autowired
    private DefaultTokenServices redisTokenService;

    /**
     * 移除access_token和refresh_token
     *
     * @param access_token
     */
    @DeleteMapping(value = "/remove_token")
    public void removeToken(String access_token) {
        redisTokenService.revokeToken(access_token);
    }

}
